/**
 * Created by DELL on 2018-02-25.
 */
// $(".Baby_Healthy_home_left_sideBar_li").on("mouseover",function(){
//     $(this).addClass('lightAct').siblings().removeClass("lightAct");
//     $(this).find('a').addClass("Baby_Healthy_home_left_sideBar_li_bgc").parents('li').siblings().find('a').removeClass("Baby_Healthy_home_left_sideBar_li_bgc");
// });
$(".Baby_Healthy_home_left_sideBar_li").on("click",function(){
    $.session.clear();
    $(this).addClass('lightAct').siblings().removeClass("lightAct");
    $(this).find('a').addClass("Baby_Healthy_home_left_sideBar_li_bgc").parents('li').siblings().find('a').removeClass("Baby_Healthy_home_left_sideBar_li_bgc");
});
// 时间戳转化
function timestampToTime(timestamp) {
    var date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
    Y = date.getFullYear() + '-';
    M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
    D = date.getDate() + ' ';
    h = date.getHours() + ':';
    m = date.getMinutes() + ':';
    s = date.getSeconds();
    return Y+M+D+h+m+s;
}
// 时间戳转化
function timestampToYMD(timestamp) {
    var date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
    Y = date.getFullYear() + '-';
    M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
    D = date.getDate() + ' ';
    return Y+M+D;
}
//获取当前时间，格式YYYY-MM-DD
function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = year + seperator1 + month + seperator1 + strDate;
    return currentdate;
}

//获取下一天时间，格式YYYY-MM-DD
function getNextFormatDate() {
    return getNextNFormatDate(1);
}


//获取下n天时间，格式YYYY-MM-DD add by zhonghua
function getNextNFormatDate(during) {
    var now = new Date();
    var date=new Date(now.getTime() + during*24*60*60*1000);
    var seperator1 = "-";
    var year = date.getFullYear();
    var month = date.getMonth()+1;
    var strDate = date.getDate() ;
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = year + seperator1 + month + seperator1 + strDate;
    return currentdate;


}


//获取url指定参数
function GetUrlParam(paraName) {
    var url = document.location.toString();
    var arrObj = url.split("?");

    if (arrObj.length > 1) {
        var arrPara = arrObj[1].split("&");
        var arr;

        for (var i = 0; i < arrPara.length; i++) {
            arr = arrPara[i].split("=");

            if (arr != null && arr[0] == paraName) {
                return arr[1];
            }
        }
        return "";
    }
    else {
        return "";
    }
}
function isNotNullFun(val) {
    return val!=null && val!='';
}
